package util.enumhelper;

import util.enumeration.Language;
import util.enumeration.UserRoleType;

public class LocalizedUserRoleType {

    // alphabetical order
    public static String getLocalizedUserRoleTypeAsString(UserRoleType userRoleType, String locale) {
        String localizedUserRoleType = "";
        
        // en_US ENGLISH, UNITED STATES
        if (locale.equals(SupportedLocale.getSupportedLocaleStringByLanguage(Language.ENGLISH_US))) {
            localizedUserRoleType = getUserRoleType_EN_US(userRoleType);
        }
        // en_SG ENGLISH, SINGAPORE
        else
        if (locale.equals(SupportedLocale.getSupportedLocaleStringByLanguage(Language.ENGLISH_SINGAPORE))) {
            localizedUserRoleType = getUserRoleType_EN_SG(userRoleType);
        }
        // ms_MY MALAY, MALAYSIA
        else
        if (locale.equals(SupportedLocale.getSupportedLocaleStringByLanguage(Language.MALAY))) {
            localizedUserRoleType = getUserRoleType_MS_MY(userRoleType);
        }
        
        // zh_CN CHINESE, CHINA
        else
        if (locale.equals(SupportedLocale.getSupportedLocaleStringByLanguage(Language.CHINESE_CHINA))) {
            localizedUserRoleType = getUserRoleType_ZH_CN(userRoleType);
        }
        // other userRoleType...
        else {
            localizedUserRoleType = getUserRoleType_EN_US(userRoleType);
        }
        
        return localizedUserRoleType;
    }
    
    // simplified chinese (zh_CN)
    private static String getUserRoleType_ZH_CN(UserRoleType userRoleType) {
        String localizedUserRoleType = "";
        
        switch (userRoleType) {
            case SUPERADMIN: localizedUserRoleType = "超级管理员" ; break;
            case ADMINISTRATOR: localizedUserRoleType = "管理员"; break;
            case STAKEHOLDER_SERVICE: localizedUserRoleType = "利益相关者服务"; break;
            case TOURIST_SERVICE: localizedUserRoleType = "旅游服务"; break;
            case NORMAL_STAFF: localizedUserRoleType = "普通员工"; break;
        }
        return localizedUserRoleType;
    }
    
    // default (en_US)
    private static String getUserRoleType_EN_US(UserRoleType userRoleType) {
        String localizedUserRoleType = "";
        
        switch (userRoleType) {
            case SUPERADMIN: localizedUserRoleType = "Super Admin" ; break;
            case ADMINISTRATOR: localizedUserRoleType = "Administrator"; break;
            case STAKEHOLDER_SERVICE: localizedUserRoleType = "Stakeholder Service"; break;
            case TOURIST_SERVICE: localizedUserRoleType = "Tourist Service"; break;
            case NORMAL_STAFF: localizedUserRoleType = "Normal Staff"; break;
        }
        return localizedUserRoleType;
    }
    
    // singapore english (en_SG)
    private static String getUserRoleType_EN_SG(UserRoleType userRoleType) {
        String localizedUserRoleType = "";
        
        switch (userRoleType) {
            case SUPERADMIN: localizedUserRoleType = "Super Admin" ; break;
            case ADMINISTRATOR: localizedUserRoleType = "Administrator"; break;
            case STAKEHOLDER_SERVICE: localizedUserRoleType = "Stakeholder Service"; break;
            case TOURIST_SERVICE: localizedUserRoleType = "Tourist Service"; break;
            case NORMAL_STAFF: localizedUserRoleType = "Normal Staff"; break;
        }
        return localizedUserRoleType;
    }
    
    // bahasa malaysia (ms_MY)
    private static String getUserRoleType_MS_MY(UserRoleType userRoleType) {
        String localizedUserRoleType = "";
        
        switch (userRoleType) {
            case SUPERADMIN: localizedUserRoleType = "Supa Pentadbir" ; break;
            case ADMINISTRATOR: localizedUserRoleType = "Pentadbir"; break;
            case STAKEHOLDER_SERVICE: localizedUserRoleType = "Pihak Berkepentingan Perkhidmatan"; break;
            case TOURIST_SERVICE: localizedUserRoleType = "Tron Perkhidmatan"; break;
            case NORMAL_STAFF: localizedUserRoleType = "Staf Biasa"; break;
        }
        return localizedUserRoleType;
    }
    
    // new userRoleType for localized userRoleType template (copy and paste to use)
//    private static String getUserRoleType_XX_YY(UserRoleType userRoleType) {
//        String localizedUserRoleType = "";
//        
//        switch (userRoleType) {
//            case CHINESE_CHINA: localizedUserRoleType = ""; break;
//            case ENGLISH_US: localizedUserRoleType = ""; break;
//            case ENGLISH_SINGAPORE: localizedUserRoleType = ""; break;
//            case MALAY: localizedUserRoleType = ""; break;
//        }
//        return localizedUserRoleType;
//    }
}